//
// Created by LoveHoneyYou on 2024-11-17.
//

#ifndef WEBSERVER_THREADPOOL_H
#define WEBSERVER_THREADPOOL_H

#include "EventLoop.h"
#include "WorkerThread.h"

class ThreadPool
{
public:
    ThreadPool(EventLoop* mainloop,int count);
    ~ThreadPool();
    void Run();
    EventLoop* Task_Worker_Event_Loop();

private:
    EventLoop* main_loop_;
    bool is_start_;
    int thread_num_;
    std::vector<WorkerThread*> worker_threads_;
    int index_;
};


#endif//WEBSERVER_THREADPOOL_H
